package com.info.dpunified.common.dataaccess;

import java.util.List;

import javax.sql.DataSource;

import org.springframework.jdbc.core.JdbcTemplate;

import com.info.dpunified.common.utils.SQLConstants;

public class DPUStaticDataDAO implements SQLConstants{

	
	
	private JdbcTemplate jdbcTemplate;

	public JdbcTemplate getJdbcTemplate() {
		return jdbcTemplate;
	}
	
	public void setDataSource(DataSource dataSource) {
		this.jdbcTemplate = new JdbcTemplate(dataSource);
	}

	/**
	 * This method returns static data from the DPU database
	 * @return
	 */
	public List<String> fetchMonths()
	{
		return this.getJdbcTemplate().queryForList(FETCH_STATIC_DATA, new String[]{"MONTH"},String.class);
	}
		
}
